﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.meeting.apply
{
    public partial class query : ModulePage
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            string str = (Request.QueryString["status"] != null) ? Request.QueryString["status"].ToString() : "0";
            MeetingDao dao = new MeetingDao();
            DataView defaultView = dao.SelectApplyAll(base.Conn, base.User.Identity.Name).DefaultView;
            string str2 = str;
            if (str2 != null)
            {
                if (!(str2 == "0"))
                {
                    if (!(str2 == "3"))
                    {
                        if (str2 == "2")
                        {
                            this.litNavTitle.Text = "未批准会议";
                            defaultView.RowFilter = "Status=2";
                            if (defaultView.Count > 0)
                            {
                                this.rptMeeting.DataSource = defaultView;
                                this.rptMeeting.DataBind();
                                return;
                            }
                            this.litMessage.Text = base.ShowMessage("无未批准会议");
                        }
                        return;
                    }
                }
                else
                {
                    this.litNavTitle.Text = "待批会议";
                    defaultView.RowFilter = "Status=0";
                    if (defaultView.Count > 0)
                    {
                        this.rptMeeting.DataSource = defaultView;
                        this.rptMeeting.DataBind();
                        return;
                    }
                    this.litMessage.Text = base.ShowMessage("无待批会议");
                    return;
                }
                this.litNavTitle.Text = "进行中会议";
                defaultView.RowFilter = "Status=1 AND StartTime <'" + DateTime.Now.ToString() + "' AND EndTime > '" + DateTime.Now.ToString() + "'";
                if (defaultView.Count > 0)
                {
                    this.rptMeeting.DataSource = defaultView;
                    this.rptMeeting.DataBind();
                }
                else
                {
                    this.litMessage.Text = base.ShowMessage("无进行中会议");
                }
            }
        } 

    }
}
